// const { SyncLoopHook }  = require('tapable')
const SyncLoopHook = require('./SyncLoopHook')

class Lesson {
  constructor(){
    this.index = 0
    this.hooks = {
      arch: new SyncLoopHook(['name'])
    }
  }
  tap(){
    this.hooks.arch.tap('react', (name)=>{
      console.log('react1',name);
      return ++this.index < 3 ? 'react初学' : undefined
    })
    this.hooks.arch.tap('node', (name)=>{
      console.log('node2',name);
      return ++this.index < 5 ? 'node初学' : undefined
    })
    this.hooks.arch.tap('react', function(name){
      console.log('react2',name);
    })
  }
  start(){
    this.hooks.arch.call('ldx')
  }
}
let l = new Lesson
l.tap()
l.start()